package com.ruoyi.xysl.service.impl;

import com.ruoyi.xysl.mapper.SysXyslUserMapper;
import com.ruoyi.xysl.service.ISysXyslUserService;
import com.xysl.api.domain.XyslUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 用户Service业务层处理
 *
 * @author xysl
 * @date 2024-12-27
 */
@Service
public class SysXyslUserServiceImpl implements ISysXyslUserService
{
    @Autowired
    private SysXyslUserMapper sysXyslUserMapper;

    /**
     * 查询用户
     *
     * @param id 用户主键
     * @return 用户
     */
    @Override
    public XyslUser selectXyslUserById(Long id)
    {
        return sysXyslUserMapper.selectXyslUserById(id);
    }

    /**
     * 查询用户
     *
     * @param account 登录账号
     * @return 用户
     */
    @Override
    public XyslUser selectXyslUserByAccount(String account)
    {
        return sysXyslUserMapper.selectXyslUserByAccount(account);
    }

    /**
     * 查询用户列表
     *
     * @param xyslUser 用户
     * @return 用户
     */
    @Override
    public List<XyslUser> selectXyslUserList(XyslUser xyslUser)
    {
        return sysXyslUserMapper.selectXyslUserList(xyslUser);
    }

    /**
     * 新增用户
     *
     * @param xyslUser 用户
     * @return 结果
     */
    @Override
    public int insertXyslUser(XyslUser xyslUser)
    {
        return sysXyslUserMapper.insertXyslUser(xyslUser);
    }

    /**
     * 修改用户
     *
     * @param xyslUser 用户
     * @return 结果
     */
    @Override
    public int updateXyslUser(XyslUser xyslUser)
    {
        return sysXyslUserMapper.updateXyslUser(xyslUser);
    }

    /**
     * 批量删除用户
     *
     * @param ids 需要删除的用户主键
     * @return 结果
     */
    @Override
    public int deleteXyslUserByIds(Long[] ids)
    {
        return sysXyslUserMapper.deleteXyslUserByIds(ids);
    }

    /**
     * 删除用户信息
     *
     * @param id 用户主键
     * @return 结果
     */
    @Override
    public int deleteXyslUserById(Long id)
    {
        return sysXyslUserMapper.deleteXyslUserById(id);
    }

    @Override
    public int resetPwd(XyslUser user) {
        return sysXyslUserMapper.updateXyslUser(user);
    }
}
